<?php $lib->alert($alert); ?>

<div class="col-md-12 row" >
  <form method="post" action="" enctype="multipart/form-data">
  <div class="col-lg-7 left-f">
  	 <header class="panel panel-primary" >
        <h4>General Information</h4>
    </header>
      <div class="form-group">
          <label for="username">Username</label>
          <input 
          	 value="<?php if(isset($detail)) echo $detail->username ?>"
          	 class="form-control" 
             name="data[username]" 
             id="username" 
             required autofocus>
         
      </div>
       <div class="form-group">
          <label for="email">Email</label>
          <input 
          	 value="<?php if(isset($detail)) echo $detail->email ?>"
          	 class="form-control" 
             name="data[email]" 
             id="email" 
              >
         
      </div>
     
      <div class="form-group">
            <label>Group user</label>
           
            <div class="checkbox">
               
                	<select
                    	name="data[groupid]" 
                        class="form-control"
                        type="radio" 
                        value="<?php echo $item['id']; ?> ">
                         <?php 
							foreach($list_role as $key=>$item)
							{
								if(is_array($item))
								{
						 ?>
                        		<option 
                                
									value="<?php echo  $item['id']; ?>"
                                    <?php if($detail->groupid == $item['id']) echo "selected";  ?>
                                    >
                                    
									<?php   echo  $item['title']; ?>
                                </option>
                        <?php
								}
							}
						?> 
                    
                    
                    </select>
                   
                     
               
            </div>
            
           
            
      </div>
      
      <?php //$lib->loadmenu(); ?>
     
      
      <div class="form-group">
          <label for="fullname">Fullname</label>
          <input 
          	 value="<?php if(isset($detail)) echo $detail->fullname; ?>"
          	 class="form-control" 
             name="data[fullname]" 
             id="fullname" >
         
      </div>
     
       <div class="form-group">
          <label for="avatar">Avatar</label>
          <?php if(isset($detail)){?>
          <div class="row">
             <img 
              style="border:1px solid #c0c0c0; 
                padding:2px; 
              	border-radius:7px; 
              	margin-left:30px; 
             	margin-bottom:30px; 
              	margin-top:13px;"
              width="200"
              src="<?php echo $detail->avatar;  ?>" 
              alt="<?php echo $detail->fullname;  ?>" 
              title="<?php echo $detail->fullname;  ?>">  
          </div>
          <?php } ?>
          <div class="row">
             <p class="col-md-10">
             <input 
             	value="<?php if(isset($detail)) echo $detail->avatar ?>"
             	class="form-control" 
                name="data[avatar]" 
                id="avatar"  >
             </p>
             <p class="col-md-2"><button onclick="browseKCFinder('avatar', 'image');return false;"  class="btn btn-primary">Chọn</button></p>
          </div>
      </div>
  </div>
  <div class="col-lg-4  right-f">
  	   <header class="panel panel-primary" >
       		<h4>Advance</h4>
       </header>
       <div class="form-group">
            <label for="publish">Display</label>
            <div class="col-md-12">
           		 <p class="col-md-4">
                     <input 
                     	<?php if(isset($detail)){ 
							if($detail->publish==1) echo "checked";
							} else echo "checked"; 
						?>
                        value="1" 
                        type="radio" 
                        name="data[publish]" 
                        id="publish">
                     <b style="padding-left:5px;">Yes</b>
                 </p>
           		 <p class="col-md-4">
                     <input 
                     	<?php if(isset($detail)){ 
							if($detail->publish==0) echo "checked";
							}  else echo ""; 
						?>
                         
                        value="0" 
                        type="radio" 
                        name="data[publish]" 
                        id="publish"> 
                     <b style="padding-left:5px;">No</b>
                 </p>
             </div>              
       </div>      
  </div><!--right-f-->
  <div class="col-lg-4  right-f">
  	   <header class="panel panel-primary" >
       		<h4>More</h4>
       </header>
       <div class="form-group">
            <label for="sex">Sex</label>
            <div class="col-md-12">
           		 <p class="col-md-4">
                     <input 
                     	<?php if(isset($detail)){ 
							if($detail->sex==1) echo "checked";
							} else echo "checked"; 
						?>
                        value="1" 
                        type="radio" 
                        name="data[sex]" 
                        id="sex">
                     <b style="padding-left:5px;">Nam</b>
                 </p>
           		 <p class="col-md-4">
                     <input 
                     	<?php if(isset($detail)){ 
							if($detail->sex==0) echo "checked";
							}  else echo ""; 
						?>
                         
                        value="0" 
                        type="radio" 
                        name="data[sex]" 
                        id="sex"> 
                     <b style="padding-left:5px;">Nữ</b>
                 </p>
             </div>              
       </div>  
       
       
		  <div class="form-group">
              <label for="phone">Phone</label>
              <input 
                 value="<?php if(isset($detail)) echo $detail->phone; ?>"
                 class="form-control" 
                 name="data[phone]" 
                 id="phone" >
             
          </div>           
         <div class="form-group">
          <label for="birthday">Birthday</label>
          <input 
          	 value="<?php 
			 if(isset($detail)){
				 if($detail->birthday != '0000-00-00 00:00:00') 
					echo gmdate('d/m/Y', strtotime($detail->birthday) + 7*3600);
				else echo '-';
				 
				 
			 }
			 ?>"
          	 class="form-control" 
             name="data[birthday]" 
             id="birthday" >
         
      </div>  
        <div class="form-group">
          <label for="address">Address</label>
          <input 
          	 value="<?php if(isset($detail)) echo $detail->address; ?>"
          	 class="form-control" 
             name="data[address]" 
             id="address" >
         
      </div>    
  </div><!--right-f-->
  
  
  
  
  
  
  <div class="col-md-12" style="padding-bottom:3em">
  	  <div class="col-md-2 col-sm-6">
      	 <button type="reset" class="btn btn-danger">Reset</button>
      </div>
       <div class="col-md-2 col-sm-6">
      	 <button type="submit" class="btn btn-primary" name="btnGui">Change</button>
      </div>    
  </div>
  </form>
</div>
<!-- /.row -->
